package com.base_data_handler.utils.ftp;

import java.io.File;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

public class Test {
	 private static Logger logger = Logger.getLogger(Test.class);  
	  
	    public static void main(String[] args) {  
	        int ftpPort = 0;  
	        String ftpUserName = "";  
	        String ftpPassword = "";  
	        String ftpHost = "";  
	        String ftpPath = "";  
	        String writeTempFielPath = "";  
	        try {  
	            InputStream in = FtpUtil.class.getClassLoader()  
	                    .getResourceAsStream("jdbc.properties");  
	            if (in == null) {  
	                logger.info("配置文件env.properties读取失败");  
	            } else {  
	                Properties properties = new Properties();  
	                properties.load(in);  
	                ftpUserName = properties.getProperty("ftp.user_name");  
	                ftpPassword = properties.getProperty("ftp.user_pass");  
	                ftpHost = properties.getProperty("ftp.host");  
	                ftpPort = Integer.valueOf(properties.getProperty("ftp.port"))  
	                        .intValue();  
	                ftpPath = "product/ankang/baihexian/huanjing/";  
	                
	                writeTempFielPath = "C:/Users/Administrator/Desktop"; 
	                
//	                String result = FtpUtil.readConfigFileForFTP(ftpUserName, ftpPassword, ftpPath, ftpHost, ftpPort, "/radar/20170601154200001.png");  
	               //  System.out.println("读取配置文件结果为：" + result);  
	                  
	                
	                FtpUtil.upload(ftpPath, ftpUserName, ftpPassword, ftpHost, ftpPort,
	                		"C:/Users/Administrator/Desktop/qq (7).JPEG");  
	            }  
	        } catch (Exception e) {  
	            e.printStackTrace();  
	        }  
	    }  
}
